package com.zito.health.controller;

import com.zito.health.common.annotations.ResponseResult;
import com.zito.health.common.result.VerifyResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: gxt
 * @time: 2019/10/12 10:57
 */
@Slf4j
@ResponseResult
@RestController
@RequestMapping("/logout")
public class LogoutController {

    @PostMapping()
    public VerifyResult logout(){
        VerifyResult verifyResult = new VerifyResult();
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return verifyResult;
    }

}
